import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'

export default defineConfig({
  plugins: [vue()],
  resolve: {
    alias: {
      '@': path.resolve(__dirname, './src'), // 确保@指向src目录
      'vue': 'vue/dist/vue.esm-bundler.js'
    },
    extensions: ['.vue', '.js', '.json', '.scss']
  },
  css: {
    preprocessorOptions: {
      scss: {
        additionalData: `@import "@/assets/styles/global.scss";`
      }
    }
  },
  server: {
    port: 5173,
    open: true,
    cors: true
  }
})